package ac.rfr.manager;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashSet;
import java.util.Set;

import ac.notification.event.INotificationListenerLite;
import ac.notification.event.NotificationEvent;
import ac.notification.manager.NotificationRegistrarLite;
import ac.rfr.store.IIdentifiers;
import ac.rfr.ui.MainWindow;

public class UIManager implements INotificationListenerLite,IIdentifiers {

	private MainWindow mainWindow;
	
	public  UIManager()
	{
		mainWindow = new MainWindow();
		registerListeners();
		mainWindow.setVisible(true);
	}
	
	private void registerListeners() {
		mainWindow.getOpenTemplateMI().addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				NotificationEvent notificationEvent = new NotificationEvent(CMD_OPEN_TEMPLATE);
				NotificationRegistrarLite.dispatchNotification(notificationEvent);
			}
		}) 	;	
	}
	@Override
	public Set<String> declaredSubscriptionSet() {
		Set<String> subscriptionSet = new HashSet<String>();
		return subscriptionSet;
	}

	@Override
	public void receiveEvent(String arg0) {
		// TODO Auto-generated method stub

	}

}
